<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
int j = 1;
Movie[] movieList;
movieList=(Movie[])session.getAttribute("billMovies");
double amount = (Double)session.getAttribute("billAmountSimple");
long memid = (Long)session.getAttribute("MembershipId");
String fname = (String)session.getAttribute("Name");
String custype = (String)session.getAttribute("CustomerType");
%>
<%@page import="com.beans.Movie"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form id="paymentForm" name="paymentForm" method="POST" action="CardServlet" >
<div class ="inputColumn" id = "CartItems"  
				style="text-align: left; border: none; margin: auto;">	
				<div style="text-align:center;font-size:1em;font-family: sans serif;">
				<% String status = (String)request.getAttribute("status");
			if(status != null){
			%>
			<label style="size: 25; color: green"><%=status%></label>	<%} %>	</div>
			<table align="center" border="1" style="border-style: dashed; background-color: rgb(254,252,180);">
			<tr>
				
				<th align="center" style="color:black" bordercolor="black">Membership Id</th>
				<th align="center" style="color:black" bordercolor="black"><%=memid%></th>
				</tr>
			</table>	
			<table align="center" border="1" style="border-style: dashed; background-color: rgb(254,252,180);">
			<tr>
				
				<th align="center" style="color:black" bordercolor="black">Name</th>
				<th align="center" style="color:black" bordercolor="black"><%=fname%></th>
				</tr>
			</table>	
			<table align="center" border="1" style="border-style: dashed; background-color: rgb(254,252,180);">
			<tr>
				
				<th align="center" style="color:black" bordercolor="black">CustomerType</th>
				<th align="center" style="color:black" bordercolor="black"><%=custype%></th>
				</tr>
			</table>	
			<table align="center" border="1" style="border-style: dashed; background-color: rgb(254,252,180);">
			<%
			if(movieList != null)
			{
			%>
				<tr>
				<th align="center" style="color:red" bordercolor="red">No</th>
				<th align="center" style="color:red" bordercolor="red">Movie Name</th>
				<th align="center" style="color:red" bordercolor="red">Rent in $</th>
				</tr>
				<% 
				
				for(int i=0;i<movieList.length;i++)
				{
				%>
				<tr bordercolor="black" >
				<td bordercolor="black">
					 	<label id ="MovieNo" style="size: 25;"><%=j++%></label> 
					</td>
				   <td bordercolor="black">
					 	<label id ="MovieName" style="size: 25;"><%=movieList[i].getMovieName()%></label> 
					</td>
					<td bordercolor="black">
					 	<label id ="Rent" style="size: 25;"><%=movieList[i].getRent()  %></label> 
					</td>		
				</tr>
				<%
				}
				%>
				
				
				
				<tr bordercolor="black" >
				<td bordercolor="black">
					 	<label id ="Total1" style="size: 25;"><b>Total</b></label> 
					</td>
				   <td bordercolor="black">
					 	<label id ="Total" style="size: 25;"><b>Rent</b></label> 
					</td>
					<td bordercolor="black">
					 	<label id ="amount" style="size: 25;"><%= amount %></label> 
					</td>		
				</tr>
				
			</table>
			<div style="text-align:center;color:red;font-size:2em;font-family: sans serif;">
			<input type="button" value="Make Payment" onclick="document.location.href='card.jsp'">
			<input type="button" value="Cancel" onclick="document.location.href='cartDetails.jsp'">
			</div>
				<%			
			}
			else
			{
			%>
			<font size="4">There are no movies rented</font>
			<%
			}
			%>
	</div>
	</form>
</body>
</html>